package com.ucode.application.controller.search;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.ucode.springboot.starter.ESsearch.annotation.ESField;
import com.ucode.springboot.starter.ESsearch.annotation.ESDocument;
import com.ucode.springboot.starter.ESsearch.enums.DataType;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor

@ApiModel(value="人员")
@ESDocument(indexName="person",idFieldName="id")
public class Person implements Serializable {

    private static final long serialVersionUID = 8510634155374943623L;

    /**
     * 主键
     */
    @ApiModelProperty(value = "Id",required=true)
    @ESField(datatype = DataType.long_type,keyword=false)
    private Long id;

    /**
     * 名字
     */
    @ApiModelProperty(value = "名字",required=true)
    @ESField(datatype = DataType.keyword_type,keyword= false,ngram=true,suggest=true)
    private String name;

    /**
     * 国家
     */
    @ApiModelProperty(value = "国家")
    @ESField(datatype = DataType.text_type,keyword= true,ngram=true,suggest=true)
    private String country;

    /**
     * 年龄
     */
    @ApiModelProperty(value = "年龄",example="19")
    @ESField(datatype = DataType.integer_type,keyword=false)
    private Integer age;

    /**
     * 生日
     */
    @ApiModelProperty(value = "生日",example="1989-08-01")
    @ESField(datatype = DataType.date_type,keyword=false)
    private Date birthday;

    /**
     * 介绍
     */
    @ApiModelProperty(value = "介绍")
    @ESField(datatype = DataType.text_type,keyword= true,ngram=true,suggest=true)
    private String remark;
    
    @ApiModelProperty(value = "详细信息",dataType="Object")
    @ESField(datatype = DataType.nested_type, nestedClass = PersonDetails.class)
    private PersonDetails details;
    
    @ApiModelProperty(value = "部门Ids")
    @ESField(datatype = DataType.long_type,keyword=false)
    private List<Long> deptIds;

}